package com.tomehay.termprojectmanage_server.controller;


import com.tomehay.termprojectmanage_server.pojo.Model.Clazz;
import com.tomehay.termprojectmanage_server.pojo.VO.ResultVO;
import com.tomehay.termprojectmanage_server.service.CourseClazzService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author tomehay
 * @since 2023-06-20
 */
@RestController
@RequestMapping("api/courseClazz")
public class CourseClazzController {
    @Autowired
    CourseClazzService courseClazzService;

    @GetMapping("/AddClazzIntoCourse")
    public ResultVO<Void> AddClazzIntoCourse(int clazz_id,int course_id){
        return courseClazzService.AddClazzIntoCourse(clazz_id,course_id);
    }

    @GetMapping("/GetClazzByCourseId")
    public ResultVO<List<Clazz>> GetClazzByCourseId(int course_id){
        return courseClazzService.GetClazzByCourseId(course_id);
    }

    @DeleteMapping("/RemoveClazzFromCourse")
    public ResultVO<Void> RemoveClazzFromCourse(int id){
        return courseClazzService.RemoveClazzFromCourse(id);
    }
}
